#pragma once

#include <ogr_api.h>
#include "UnitType.h"
#include "MapLayer.h"

class CVectorLayer;
class CGeometry;

class CVectorDataProvider
{
public:
	CVectorDataProvider(TCHAR* pFilePath);
	~CVectorDataProvider(void);
	CVectorLayer* createVectorLayer();
	bool createCoordinateFromWkt(TCHAR* theWkt);
	bool createGeometrys();
private:
	OGRDataSourceH m_pOgrDataSource;
	OGRLayerH m_pOgrLayer;
	OGRSFDriverH m_pOgrDriver;
	TCHAR* m_pFilePath;
	OGRSpatialReferenceH m_crs;
	CMapLayerEnvelope m_layerEnvelope;
	OGRwkbGeometryType m_geomType;
	UnitType m_unitType;
	int m_geometryCount;
	CArray<CGeometry*>* m_geometries;
};
